#!/usr/bin/env python
#################################################################################
#   Copyright (C) 2007 Daniel Kersten / Tim Kersten                             #
#   (See the file AUTHORS for details.)                                         #
#                                                                               #
#   Nexus-Ed is free software; you can redistribute it and/or modify            #
#   it under the terms of the GNU General Public License as published by        #
#   the Free Software Foundation; either version 2 of the License, or           #
#   (at your option) any later version.                                         #
#                                                                               #
#   Nexus-Ed is distributed in the hope that it will be useful,                 #
#   but WITHOUT ANY WARRANTY; without even the implied warranty of              #
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                #
#   GNU General Public License for more details.                                #
#                                                                               #
#   You should have received a copy of the GNU General Public License           #
#   along with Nexus-Ed; if not, write to the Free Software                     #
#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA    #
#   or visit http://www.gnu.org/licenses/gpl.txt                                #
#                                                                               #
#################################################################################

import socket


class NetworkHandler:
	"""
	Handle all network connections here.
	"""
	def __init__ (self, host='localhost', port=11018):
		self.host = host
		self.port = port
		pass
		
	def connect (self):
		s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
		s.connect((self.host, self.port))
		s.send('Hello, world')
		data = s.recv(1024)
		s.close()
		print 'Received', repr(data)
		
	def notify (self, fileID, changes):
		pass